#include <VolumeUnit.h>
const unsigned int MAX_VOLUME_UNIT_INSTANCE_NUMBER = 3;

UnitMgr<VolumeUnit>  VolumeUnit::unitMgr(MAX_VOLUME_UNIT_INSTANCE_NUMBER);

const UnitAttribute vilumeUnitAttributeTab[MAX_VOLUME_UNIT_INSTANCE_NUMBER] = 
{
//Name | Factor |M0 M1/* M2 M3*/
{"Oz", 	 2*3, 	{1, 0/*, 0, 1*/}},//Oz
{"Tbsp", 3, 	{1, 0/*, 1, 1*/}},//Tbsp
{"Tsp",  1, 	{1, 1/*, 1, 0*/}} //Tsp
};

VolumeUnit::VolumeUnit(const UnitAttribute & unitPara)
:Unit(unitPara)
{
	unitMgr.storeUnit(this);
}

const  VolumeUnit& VolumeUnit::oz()
{
	static const  VolumeUnit oz(vilumeUnitAttributeTab[0]);
	return oz;
}
const VolumeUnit& VolumeUnit::tbsp()
{
	static  const VolumeUnit  tbsp(vilumeUnitAttributeTab[1]);
	return tbsp;
}

const VolumeUnit& VolumeUnit::tsp()
{
	static  const VolumeUnit tsp(vilumeUnitAttributeTab[2]);
	return tsp;
}

void  VolumeUnit::initUnitTab()
{
	tsp();
	oz();
        tbsp();
	return; 
}
